package com.liveinstars.api.im;

import com.liveinstars.api.im.vo.TodoVO;
import com.onepiece.shipelves.common.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author: ting
 * @date: 2020/3/6
 */
@FeignClient("im")
public interface TodoApi {


    @PostMapping("/listTodo")
    Result<List<TodoVO>> listAll();

    /**
     * 查询申请中的活动
     * @param userId
     * @param type
     * @return
     */
    @GetMapping("/listActivityTodo")
    List<TodoVO> listActivityTodo(@RequestParam("user_id") Long userId, @RequestParam("type") Integer type);

    @GetMapping("/addTodoResult")
    Result<TodoVO> addTodoResult(@RequestParam("from_user_id") Long fromUserId, @RequestParam("to_user_id") Long toUserId,
                   @RequestParam("type") int type,
                   @RequestParam("activity_id") Integer activityId, @RequestParam("group_id") Long groupId, @RequestParam("req_msg") String reqMsg);

    @GetMapping("/addTodo")
    TodoVO addTodo(@RequestParam("from_user_id") Long fromUserId, @RequestParam("to_user_id") Long toUserId,
                   @RequestParam("type") int type,
                   @RequestParam("activity_id") Integer activityId, @RequestParam("group_id") Long groupId, @RequestParam("req_msg") String reqMsg);

    @GetMapping("/hasJoinTodo")
    Boolean hasJoinTodo(@RequestParam("user_id") Long userId, @RequestParam("id") Integer id);
}
